/* ---------------------------------------------------------------------------- * Copyright © 2015-Present Aries Systems Corporation. All Rights Reserved. * Copying, reverse engineering, adaptation or any other derivative use * prohibited. This material is proprietary and confidential information * of Aries Systems Corporation. * * Date Created: 20150806 BBD * Version Introduced: 13.0 * Spec #: 13.0 * * Depends: * jquery.js * jquery.ui.js * cssSiteStyle.css * cssjQueryDialog.css * --------------------------------------------------------------------------*/ // Summary: Duplicate of jQueryAlerts.js located in Resources folder // Extension to jQuery UI's dialog widget to implement // Confirm Dialog with similar functionality to browser's native confirm dialog /* ---------------------------------------------------------------------------- * Copyright © 2015-Present Aries Systems Corporation. All Rights Reserved. * Copying, reverse engineering, adaptation or any other derivative use * prohibited. This material is proprietary and confidential information * of Aries Systems Corporation. * * Date Created: 20150806 BBD * Version Introduced: 13.0 * Spec #: 13.0 * * Depends: * jquery.js * jquery.ui.js * cssSiteStyle.css * cssjQueryDialog.css * --------------------------------------------------------------------------*/ // Summary: Duplicate of jQueryAlerts.js located in Resources folder // Extension to jQuery UI's dialog widget to implement // Confirm Dialog with similar functionality to browser's native confirm dialog (function ($) { $.widget('fl.confirmDialog', $.ui.dialog, { options: { modal: true, titleText: '', titleIcon: '', //options are 'warning', 'error' messageText: '', okText: '', cancelText: '', timerID: null, // 13.0-10 20150818 BBD reloadPage: '', // 13.0-10 20150818 BBD reloadDelay: null, // 13.0-10 20150818 BBD callback: function () { } // callback to receive the user response. true for ok, false for cancel. }, _create: function () { var that = this; that.options.title = that.options.titleText; that.element.html('
' + that.options.messageText + '
'); that.options.buttons = [ { text: that.options.okText, click: function () { that.close(); if (that.options.callback) { that.options.callback(true); } that.destroy(); } }, { text: that.options.cancelText, click: function () { that.close(); // 13.0-10 20150818 BBD if (that.options.timerID != null && that.options.reloadPage != '') { timerID = window.setTimeout("window.location.href='" + that.options.reloadPage + "'", that.options.reloadDelay); } if (that.options.callback) { that.options.callback(false); } that.destroy(); } }]; // 13.0-10 20150818 BBD if (that.options.timerID != null) { window.clearTimeout(that.options.timerID); } this._super(); //TT#32807 20180401 VP, set title icon if (that.options.titleIcon === 'warning' || that.options.titleIcon === 'error') { var $titlebar = that.element.siblings('.ui-dialog-titlebar'); if ($titlebar.length) { $titlebar.prepend(''); //style pulled from cssSiteStyle.aspx $titlebar.find('.ui-dialog-title').css({ 'float': 'none', 'margin-left': '5px' }); } } // TT#34747 20200107 TGW - handle close icon that.element.siblings('.ui-dialog-titlebar').find('.ui-dialog-titlebar-close').click(function() { that.close(); if (that.options.timerID != null && that.options.reloadPage != '') { timerID = window.setTimeout("window.location.href='" + that.options.reloadPage + "'", that.options.reloadDelay); } if (that.options.callback) { that.options.callback(false); } that.destroy(); } ); }, _destroy: function () { var that = this; that.element.html(''); that._super(); } }); })(jQuery); // Summary: Extension to jQuery UI's dialog widget to implement Confirm Dialog // that takes any number of buttons which can be specified in buttonTexts option. (function ($) { $.widget('fl.confirmDialog2', $.ui.dialog, { options: { modal: true, titleText: '', titleIcon: '', //options are 'warning', 'error' messageText: '', buttonTexts: [], // array of button items, each item is a object literal, example {text: 'OK', response: 'OK'} timerID: null, // 13.0-10 20150818 BBD reloadPage: '', // 13.0-10 20150818 BBD reloadDelay: null, // 13.0-10 20150818 BBD callback: function () { } // callback to receive the user response. true for ok, false for cancel. }, _create: function () { var that = this; that.options.title = that.options.titleText; that.element.html('' + that.options.messageText + '
'); if ($.isArray(that.options.buttonTexts)) { that.options.buttons = []; $.each(that.options.buttonTexts, function (index, item) { that.options.buttons.push({ text: item.text, click: function () { that.close(); // 13.0-10 20150818 BBD if (that.options.timerID != null && that.options.reloadPage != '') { timerID = window.setTimeout("window.location.href='" + that.options.reloadPage + "'", that.options.reloadDelay); } if (that.options.callback) { that.options.callback(item.response); } that.destroy(); } }); }); } else { throw new Error('widget confirmDialog2 error: Invalid option value for buttonTexts'); } // 13.0-10 20150818 BBD if (that.options.timerID != null) { window.clearTimeout(that.options.timerID); } this._super(); //TT#32807 20180401 VP, set title icon if (that.options.titleIcon === 'warning' || that.options.titleIcon === 'error') { var $titlebar = that.element.siblings('.ui-dialog-titlebar'); if ($titlebar.length) { $titlebar.prepend(''); //style pulled from cssSiteStyle.aspx $titlebar.find('.ui-dialog-title').css({ 'float': 'none', 'margin-left': '5px' }); } } // TT#34747 20200122 TGW - handle close icon that.element.siblings('.ui-dialog-titlebar').find('.ui-dialog-titlebar-close').click(function () { that.close(); if (that.options.timerID != null && that.options.reloadPage != '') { timerID = window.setTimeout("window.location.href='" + that.options.reloadPage + "'", that.options.reloadDelay); } if (that.options.callback) { that.options.callback(false); } that.destroy(); } ); }, _destroy: function () { var that = this; that.element.html(''); that._super(); } }); })(jQuery); // Summary: Extension to jQuery UI's dialog widget to implement // Alert Dialog with similar functionality to browser's native alert dialog (function ($) { $.widget('fl.alertDialog', $.ui.dialog, { options: { modal: true, titleText: '', titleIcon: '', //options are 'warning', 'error' messageText: '', okText: '', timerID: null, // 13.0-10 20150818 BBD reloadPage: '', // 13.0-10 20150818 BBD reloadDelay: null, // 13.0-10 20150818 BBD callback: function () { } // callback to receive user response. }, _create: function () { var that = this; that.options.title = that.options.titleText; that.element.html('' + that.options.messageText + '
'); that.options.buttons = [ { text: that.options.okText, click: function () { that.close(); // 13.0-10 20150818 BBD if (that.options.timerID != null && that.options.reloadPage != '') { timerID = window.setTimeout("window.location.href='" + that.options.reloadPage + "'", that.options.reloadDelay); } if (that.options.callback) { that.options.callback(); } that.destroy(); } }]; // 13.0-10 20150818 BBD if (that.options.timerID != null) { window.clearTimeout(that.options.timerID); } this._super(); //TT#32807 20180401 VP, set title icon if (that.options.titleIcon === 'warning' || that.options.titleIcon === 'error') { var $titlebar = that.element.siblings('.ui-dialog-titlebar'); if ($titlebar.length) { $titlebar.prepend(''); //style pulled from cssSiteStyle.aspx $titlebar.find('.ui-dialog-title').css({ 'float': 'none', 'margin-left': '5px' }); } } // TT#34747 20200122 TGW - handle close icon that.element.siblings('.ui-dialog-titlebar').find('.ui-dialog-titlebar-close').click(function () { that.close(); if (that.options.timerID != null && that.options.reloadPage != '') { timerID = window.setTimeout("window.location.href='" + that.options.reloadPage + "'", that.options.reloadDelay); } if (that.options.callback) { that.options.callback(false); } that.destroy(); } ); }, _destroy: function () { var that = this; that.element.html(''); that._super(); } }); })(jQuery);